package com.kuang.swagger.controller;

import com.kuang.swagger.pojo.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author: Zhang Dongwei
 * Date: 2022/8/7 14:11
 */
@RestController
public class HelloController {
    @GetMapping("/hello")
    public String hello(){
        return "hello";
    }

//    只要我们的接口中，返回值中存在实体类，就会被扫描到swagger中
    @PostMapping("/user")
    public User user(){
        return new User();
    }
}
